package com.cm.figure.model;

import java.util.Objects;

public class User {
    private Long id;

    private String username;

    private String password;

    private String avatar;

    private String nickname;

    private String email;

    private String creattime;

    private String updatetime;

    private String token;

    private String filepath;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getCreattime() {
        return creattime;
    }

    public void setCreattime(String creattime) {
        this.creattime = creattime;
    }

    public String getUpdatetime() {
        return updatetime;
    }

    public void setUpdatetime(String updatetime) {
        this.updatetime = updatetime;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getFilepath() {
        return filepath;
    }

    public void setFilepath(String filepath) {
        this.filepath = filepath;
    }

    public User() {
    }

    public User(Long id, String username, String password, String avatar, String nickname, String email, String creattime, String updatetime, String token, String filepath) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.avatar = avatar;
        this.nickname = nickname;
        this.email = email;
        this.creattime = creattime;
        this.updatetime = updatetime;
        this.token = token;
        this.filepath = filepath;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", avatar='" + avatar + '\'' +
                ", nickname='" + nickname + '\'' +
                ", email='" + email + '\'' +
                ", creattime='" + creattime + '\'' +
                ", updatetime='" + updatetime + '\'' +
                ", token='" + token + '\'' +
                ", filepath='" + filepath + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return Objects.equals(id, user.id) &&
                Objects.equals(username, user.username) &&
                Objects.equals(password, user.password) &&
                Objects.equals(avatar, user.avatar) &&
                Objects.equals(nickname, user.nickname) &&
                Objects.equals(email, user.email) &&
                Objects.equals(creattime, user.creattime) &&
                Objects.equals(updatetime, user.updatetime) &&
                Objects.equals(token, user.token);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, username, password, avatar, nickname, email, creattime, updatetime, token);
    }
}